package com.yuandengta.yomall.auth.feign;

import com.yuandengta.common.utils.R;
import com.yuandengta.yomall.auth.vo.UserLoginVO;
import com.yuandengta.yomall.auth.vo.UserRegisterVO;
import com.yuandengta.yomall.auth.vo.WeiboUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient("yomall-member")
public interface MemberFeignService {


    /**
     * 会员注册
     * @param registerVO
     * @return
     */
    @PostMapping("/member/member/reg")
    R register(@RequestBody UserRegisterVO registerVO);

    /**
     * 会员登录
     * @param vo
     * @return
     */
    @PostMapping("/member/member/login")
    R login(@RequestBody UserLoginVO vo);

    /**
     * 检查用户是否唯一
     * @param username
     * @return
     */
    @GetMapping("/member/member/check/user/{username}")
    R checkUser(@PathVariable("username") String username);

    /**
     * 检查手机号是否唯一
     * @param mobile
     * @return
     */
    @GetMapping("/member/member/check/mobile/{mobile}")
    R checkMobile(@PathVariable("mobile") String mobile);

    /**
     * 微博登录
     * @param weiboUser
     * @return
     */
    @PostMapping("/member/member/oauth/weibo/login")
    R weiboLogin(@RequestBody WeiboUser weiboUser);
}
